

package com.hazelcast.instance;

import com.hazelcast.instance.impl.DefaultNodeContext;
import com.hazelcast.instance.impl.Node;
import com.hazelcast.internal.server.FirewallingServer;
import com.hazelcast.internal.server.Server;
import com.hazelcast.internal.server.tcp.LocalAddressRegistry;
import com.hazelcast.internal.server.tcp.ServerSocketRegistry;

import java.util.Collections;

/**
 * Creates a {@link DefaultNodeContext} with wrapping its ConnectionManager
 * with a {@link FirewallingServer.FirewallingServerConnectionManager}.
 */
public class FirewallingNodeContext extends DefaultNodeContext {

    @Override
    public Server createServer(Node node, ServerSocketRegistry registry, LocalAddressRegistry addressRegistry) {
        Server server = super.createServer(node, registry, addressRegistry);
        return new FirewallingServer(server, Collections.emptySet());
    }

}
